<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <?php include_http_metas() ?>
    <?php include_metas() ?>
    <title>
	  <?php if (!include_slot('title')): ?>
        SMART Manager - Your best companion in managing projects 
      <?php endif; ?>
    </title>
    <link rel="shortcut icon" href="/favicon.ico" />
    <?php include_stylesheets() ?>
    <?php use_javascript('jquery-1.4.2.min.js') ?>
    <?php use_javascript('selected_project.js') ?>
    <?php include_javascripts() ?>
  </head>
  <body>
    <table width="999" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#E2E2E2">
      <tr>
        <td width="90">&nbsp;</td>
        <td height="116" bordercolor="#000000"><a href="<?php echo url_for('@homepage') ?>"><img src="/images/mainpage-sliced_02.jpg" width="824" height="100" alt="SMART Manager" border="0"/></a></td>
        <td width="91">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td bordercolor="#000000" background="/images/mainpage-sliced_11.jpg">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <?php 
	           if ($sf_user->isAuthenticated())
		       { 
		 ?>
            <tr>
              <td class="style2">Welcome <?php echo $sf_user->getResourceName(); ?>: </td>
              <td class="style2" align="right">
              <form>
              Selected Project: <select name="selected_projectid" id="user_projectid" onchange='OnChange(this.form.selected_projectid);'><?php echo htmlspecialchars_decode($sf_user->getProjectsDropdown(), ENT_QUOTES); ?></select></form>
              </td>
            </tr>
            <?php } ?>
          </table>
        </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
    <td>&nbsp;</td>
    <td bordercolor="#000000"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <?php 
	     if ($sf_user->isAuthenticated())
		 { ?>
        <td width="205" valign="top" bgcolor="#DADADA">
        
        <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#DADADA">
          <tr>
            <td style="border-bottom:solid 1px #C7C7C7;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="10">&nbsp;</td>
                <td width="20"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="." /></td>
                <td><span class="style2"><a href="<?php echo url_for('@homepage') ?>">Home</a></span></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td valign="top" style="border-bottom:solid 1px #C7C7C7;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="10" colspan="3" style="border-top:solid 1px #EDEDED;"><img src="/images/spacer.gif" width="1" height="10" /></td>
                </tr>
              <tr>
                <td width="10">&nbsp;</td>
                <td width="20"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                <td class="style2">My Account</td>
              </tr>
              
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="10"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                    <td width="165"><span class="style3"><a href="<?php echo url_for(array('module' => 'resource', 'action' => 'show', 'resourceid' => $sf_user->getGuardUser()->getResource()->getResourceid(), 'loginuserid' => $sf_user->getUserId()))?>">View Profile</a></span> </td>
                  </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <?php 
	      if ($sf_user->hasPermission("project.create") || $sf_user->hasPermission("project.edit") || $sf_user->hasPermission("project.view")){ ?>
          <tr>
            <td height="30" style="border-top:solid 1px #EDEDED; border-bottom:solid 1px #C7C7C7;">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">              
              <tr>
                <td width="10">&nbsp;</td>
                <td width="20"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                <td class="style2">Manage Projects</td>
              </tr>          
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <?php 
	     			if ($sf_user->hasPermission("project.create"))
		 			{ 
					?>
                  <tr>
                    <td width="10"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                    <td width="165"><span class="style3"><a href="<?php echo url_for('project/new') ?>">Create Project</a></span> </td>
                  </tr>
                  <?php } ?>
                  <?php 
	     			if ($sf_user->hasPermission("project.update"))
		 			{  
					?>
                  <tr>
                    <td width="10"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                    <td><span class="style3"><a href="<?php 
					$selectedProject = $sf_user->getAttribute('selectedProject');
					if ($selectedProject == null){					  
					  echo url_for('project/index'); 
					  $sf_user->setFlash('error', 'Please select a Project.', false);
					}
					else{
					  echo url_for('project_edit', $selectedProject);					
					}
					?>">Edit Current Project</a></span> </td>
                  </tr>
                  <?php } ?>
                  <?php 
	     			if ($sf_user->hasPermission("project.view"))
		 			{ 
					?>
                  <tr>
                    <td width="10"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                    <td><span class="style3"><a href="<?php 
					$selectedProject = $sf_user->getAttribute('selectedProject');
					if ($selectedProject == null){					  
					  echo url_for('project/index'); 
					  $sf_user->setFlash('error', 'Please select a Project.', false);
					}
					else{
					  echo url_for('project_show', $selectedProject);					
					} 
					?>">View Current Project Info</a></span></td>
                  </tr>
                  <?php } ?>                  
                </table>
                </td>
              </tr>
            </table>
            </td>
          </tr>
          <?php } ?>
          <?php 
		  if ($sf_user->hasPermission("milestone.create") || $sf_user->hasPermission("milestone.update") || $sf_user->hasPermission("milestone.view"))
		  { 
		  ?>
          <tr>
            <td style="border-top:solid 1px #EDEDED; border-bottom:solid 1px #C7C7C7;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="10">&nbsp;</td>
                <td width="20"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                <td class="style2">Manage Milestones</td>
              </tr>              
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <?php 
	     			if ($sf_user->hasPermission("milestone.create"))
		 			{ 
					?>
                  <tr>
                    <td width="10"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                    <td width="165"><span class="style3"><a href="<?php echo url_for('milestone/new') ?>">Create Milestone</a></span> </td>
                  </tr>
                  <?php } ?>
                  <?php 
	     			if ($sf_user->hasPermission("milestone.update"))
		 			{ 
					?>
                  
                  <?php } ?>
                  <?php 
	     			if ($sf_user->hasPermission("milestone.view"))
		 			{ 
					?>
                  <tr> 
                    <td width="10"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                    <td><span class="style3"><a href="<?php echo url_for('milestone/index') ?>">View Project Milestones</a></span></td>
                  </tr>
                  <?php } ?>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <?php } ?>
          <tr>
            <td height="30" style="border-top:solid 1px #EDEDED; border-bottom:solid 1px #C7C7C7;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
               <?php 
	     			if ($sf_user->hasPermission("task.create") || $sf_user->hasPermission("task.update") || $sf_user->hasPermission("task.view"))
		 			{ 
					?>
              <tr>
                <td width="10">&nbsp;</td>
                <td width="20"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                <td class="style2">Manage Tasks</td>
              </tr>
              <?php } ?>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <?php 
	     			if ($sf_user->hasPermission("task.create"))
		 			{ 
					?>
                    <tr>
                      <td width="10"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                      <td width="165"><span class="style3"><a href="<?php echo url_for('task/new') ?>">Create Tasks</a></span> </td>
                    </tr> 
                    <?php } ?>
                    <?php 
	     			if ($sf_user->hasPermission("task.update"))
		 			{ 
					?>
                    
                    <?php }                    
	     			if ($sf_user->hasPermission("task.view"))
		 			{ 
					?>
                    <tr>
                      <td><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="&gt;&gt;" /></td>
                      <td><span class="style3"><a href="<?php echo url_for('task/index') ?>">View Tasks (Milestones)</a></span></td>
                    </tr>
                    <?php }                    
	     			if ($sf_user->hasGroup("manager"))
		 			{ 
					?>
                    <tr>
                      <td width="10"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                      <td><span class="style3"><a href="<?php echo url_for('task/search') ?>">Search</a><a href="<?php echo url_for('task/index') ?>"></a></span></td>
                    </tr>
                    <?php } ?>
                </table></td>
              </tr>
            </table></td>
          </tr>
          <?php 
		  if ($sf_user->hasGroup("manager"))
		  { 
	      ?>
          <tr>
            <td height="30" style="border-top:solid 1px #EDEDED; border-bottom:solid 1px #C7C7C7;">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>&nbsp;</td>
                <td><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="&gt;&gt;" /></td>
                <td class="style2">Manage Resources</td>
              </tr>
              <tr>
                <td width="10">&nbsp;</td>
                <td width="20">&nbsp;</td>
                <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                      <td><span class="style3"><a href="<?php echo url_for('resource/index') ?>">View Resources Info</a></span></td>
                    </tr>
                    <tr>
                      <td><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                      <td><span class="style3"><a href="<?php echo url_for('resource/assigncost') ?>">Assign Resources Cost</a></span></td>
                    </tr>
                    <?php 
	     		    if ($sf_user->hasPermission("resource.viewcost"))
		 			{ 
				    ?>
                    <tr>
                      <td><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="&gt;&gt;" /></td>
                      <td><span class="style3"><a href="<?php echo url_for('resource/viewcost') ?>">View Resource Cost</a></span> </td>
                    </tr>
                    <?php }?>
                  </table>                
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
            
            <td height="30" style="border-top:solid 1px #EDEDED; border-bottom:solid 1px #C7C7C7;">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%">&nbsp;</td>
                <td width="10%"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="&gt;&gt;" /></td>
                <td width="85%" class="style2">Budget/Cost Tracking</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    
                   <?php 
				     }
				     if ($sf_user->hasPermission("resource.viewcostperday"))
		 			 {
				   ?>
                   <tr>
                     <td><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="&gt;&gt;" /></td>
                     <td><span class="style3"><a href="<?php echo url_for('task/viewcostperday') ?>">View Cost per Day</a></span> </td>
                   </tr>
                   <?php 				     
				     if ($sf_user->hasPermission("resource.viewcostpermilestone"))
		 			 {
				   ?>
                   <tr>
                    <td width="10"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                    <td width="165"><span class="style3"><a href="<?php echo url_for('task/viewcostpermilestone') ?>">View Cost per Milestone</a></span></td>
                  </tr>
                  <?php } ?>
                </table></td>
              </tr>
          
            </table></td>
          </tr>
          <?php } ?>
          <tr>
            <td height="30" style="border-top:solid 1px #EDEDED; border-bottom:solid 1px #C7C7C7;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="10">&nbsp;</td>
                <td width="20"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                <td class="style2"><a href="#">View Project Versions</a></td>
              </tr>
              
                    <tr>
                    <td width="10">&nbsp;</td>
                    <td width="20"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                    <td class="style2"><a href="#"></a></span><a href="#">Help</a></td>
                  </tr>
            </table></td>
          </tr>
          <tr>
            <td height="30" style="border-top:solid 1px #EDEDED;"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="10">&nbsp;</td>
                <td width="20"><img src="/images/mainpage-sliced_19.jpg" width="7" height="7" alt="" /></td>
                <td class="style2"><?php echo link_to('Logout', '@sf_guard_signout') ?></td>
              </tr>
            </table></td>
          </tr>
            <tr>
              <td height="30" style="border-top:solid 1px #EDEDED;">&nbsp;</td>
            </tr>
          
        </table>
          
        </td>
        <?php }?>
        <td valign="top" bgcolor="#FFFFFF">
          <?php if ($sf_user->hasFlash('notice')): ?>
            <div class="flash_notice"><?php echo $sf_user->getFlash('notice') ?></div>
          <?php endif ?> 
          <?php if ($sf_user->hasFlash('error')): ?>
            <div class="flash_error"><?php echo $sf_user->getFlash('error') ?></div>
          <?php endif ?>
          <?php echo $sf_content ?></td>
      </tr>
    </table></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td height="89" align="center" bordercolor="#000000" background="/images/footer_35.jpg" class="style3" style="line-height:20px;"><span class="style6"><a href="#">Home</a>   &nbsp;&nbsp;|&nbsp;&nbsp;   <a href="#">Company Information</a>&nbsp;&nbsp;   |&nbsp;&nbsp;   <a href="#">Latest News</a>&nbsp;&nbsp;   |&nbsp;&nbsp;   <a href="#">Privacy</a><br />
    </span><span class="style3" style="line-height:20px;"><span class="style6"> <span class="style7">Copyright 2009 <a href="#"><strong>Smart Manager Software</strong></a> All Rights Reserved</span></span></span><br /></td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>